home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / lite411q.zip / LDEMO2.BAS < prev    next >
BASIC Source File  |  1991-07-25  |  4KB  |  118 lines

  1.  
  2. '============================================================================
  3. '
  4. '                      LDEMO2.BAS - LITE Window Demo #2
  5. '                         ProWindows(tm) LITE 4.00
  6. '              (c) Copyright 1988-1991 DSE Software Publishing
  7. '
  8. '==========================================================================
  9. '
  10. '    To make use of this demonstration program, you must load BASIC
  11. '    EXATCLY as follows:
  12. '
  13. '         QB LDEMO2 /AH /L LITEDEMO               (for QuickBASIC)
  14. '         QBX LDEMO2 /AH /EA /L LITEDEMO          (for BASIC PDS 7)
  15. '
  16. '==========================================================================
  17.  
  18. REM $DYNAMIC
  19. DEFINT A-Z
  20.  
  21. ' =======================================================================
  22. ' INCLUDE modules should follow
  23. ' =======================================================================
  24.  
  25. REM $INCLUDE: 'lite.bi'
  26.  
  27. DECLARE FUNCTION PeekI% (segment%, offset%)
  28. DECLARE FUNCTION RAND%
  29. DECLARE SUB SEEDRAND (SEED%)
  30.  
  31.  
  32. 'CLEAR , , 4096&                    ' Set aside additional stack space
  33.  
  34. ' =======================================================================
  35. ' These constants should be defined in ALL applications.
  36. ' =======================================================================
  37.  
  38. CONST WINMEMSIZE% = 8191           ' Window memory, used by 'VirMem%()'
  39. CONST SCRNMEMSIZE% = 4096          ' Screen storage memory, used by 'scrn%()'
  40. CONST MAXWINDOWS% = 30             ' Maximum number of windows
  41.  
  42. ' =======================================================================
  43. ' Be sure to DIM your variables
  44. ' =======================================================================
  45.  
  46. DIM SHARED VirMem(WINMEMSIZE) AS INTEGER
  47. DIM SHARED scrn(SCRNMEMSIZE) AS INTEGER
  48. DIM SHARED vcb(MAXWINDOWS) AS vircb
  49. DIM SHARED wcb(MAXWINDOWS) AS wincb
  50. DIM SHARED wcbndx(MAXWINDOWS) AS INTEGER
  51.  
  52. ' =======================================================================
  53. ' Program initialization code
  54. ' =======================================================================
  55.  
  56.     ReCycleMode 1                           ' enable "Video Recycling" saves 24K
  57.  
  58.     InitPro                                 ' initialize ProWindows
  59.  
  60.     MouseInstalled = CheckMouse(buttons)
  61.     
  62. ' =======================================================================
  63. ' Your code goes here
  64. ' =======================================================================
  65.     
  66. MainMenu:
  67.  
  68. ' =======================================================================
  69. ' Remove next two "REM" statements for simulated monochrome mode
  70. ' =======================================================================
  71.  
  72.     REM SetBWmode ENABLE
  73.     REM SetMonitorColor 6   '1 is blue, 2 is green, 6 is amber, etc...
  74.     
  75.     FillScreen 1, 1, 25, 80, attr(0, 1), 176, SNOW
  76.  
  77.     OpenWindow 1, 15, 37, attr(0, 7), 1, 1, 1, GlobalOptions
  78.     OpenWindow 2, 15, 37, attr(7, 1), 1, 1, 1, GlobalOptions
  79.     OpenWindow 3, 15, 37, attr(15, 4), 1, 1, 1, GlobalOptions
  80.     OpenWindow 4, 15, 37, attr(15, 2), 1, 1, 1, GlobalOptions
  81.     OpenWindow 5, 15, 37, attr(15, 5), 1, 1, 1, GlobalOptions
  82.  
  83.     FOR x = 1 TO 5
  84.         setWindow x
  85.         TitleWindow 1, "Window" + STR$(x)
  86.     NEXT
  87.  
  88.     Notice
  89.  
  90.     DisplayWindow 1, 2, 10, 15, 37
  91.     DisplayWindow 2, 4, 15, 15, 37
  92.     DisplayWindow 3, 6, 20, 15, 37
  93.     DisplayWindow 4, 8, 25, 15, 37
  94.     DisplayWindow 5, 10, 30, 15, 37
  95.     
  96.     WHILE INKEY$ = ""
  97.  
  98.         Handle = ABS(RAND) MOD 4 + 1
  99.         row = ABS(RAND) MOD 15 + 1
  100.         col = ABS(RAND) MOD 40 + 1
  101.  
  102.         MoveWindow Handle, row, col
  103.  
  104.         Handle = ABS(RAND) MOD 4 + 1
  105.  
  106.         MainWindow Handle
  107.  
  108.     WEND
  109.     
  110.     FOR Handle = 1 TO 5
  111.         CloseWindow Handle
  112.     NEXT
  113.  
  114.         MouseCursorOff
  115.     CLS
  116.     PRINT "Thanks for running me!"
  117.  
  118.